var  stocks = [
    {
        'name':'西王食品',//股票名称
        'code':'sz000639',//股票代码
        'cost_price':9.900,  //成本价
        'position':100, //持仓
    },
    {
        'name':'广汇能源',//股票名称
        'code':'sh600256',//股票代码
        'cost_price':4.765,  //成本价
        'position':200, //持仓
    },
    {
        'name':'科达股份',//股票名称
        'code':'sh600986',//股票代码
        'cost_price':6.270,  //成本价
        'position':200, //持仓
    },
    {
        'name':'德邦股份',//股票名称
        'code':'sh603056',//股票代码
        'cost_price':24.131,  //成本价
        'position':100, //持仓
    }
];

var dynamicLoading = {
    css: function(path){
        if(!path || path.length === 0){
            throw new Error('argument "path" is required !');
        }
        var head = document.getElementsByTagName('head')[0];
        var link = document.createElement('link');
        link.href = path;
        link.rel = 'stylesheet';
        link.type = 'text/css';
        head.appendChild(link);
    },
    js: function(path){
        if(!path || path.length === 0){
            throw new Error('argument "path" is required !');
        }
        var head = document.getElementsByTagName('head')[0];
        var script = document.createElement('script');
        script.src = path;
        script.type = 'text/javascript';
        head.appendChild(script);
    }
};
